﻿#ifndef _VECTORFETURECLASSOPERATOR_H_H_
#define _VECTORFETURECLASSOPERATOR_H_H_

#include "udatabase/dll_cfg.h"
#include "udatabase/interface/idatasetoperator.h"
#include "geometry/interface/igeometry.h"
#include "udatabase/interface/ifield.h"
#include "udatabase/interface/ifields.h"
#include "udatabase/interface/iqueryfilter.h"
#include "udatabase/interface/ifeature.h"
#include "udatabase/interface/ifeatureclass2.h"

namespace FD{
	namespace Utility{
		namespace DB{


class CVectorFeatureClassOperator : public FD::Utility::DB::Interface::IDatasetOperator
{
public:
	virtual ~CVectorFeatureClassOperator()
	{}
public:

	virtual FD::Utility::DB::Interface::IDataSource* getDataSourceRef() {return NULL;}
	//=============================================================
	virtual bool openDataset(FD::Kernel::DataStream &stream,const String &name){ return false;}
	virtual bool createDataset(/*_in*/ FD::Kernel::DataStream &stream){ return false;}
	virtual bool deleteDataset(const String &name){ return false;}

	virtual bool addFeature(/*_in*/ FD::Kernel::DataStream &feature) {return false;}
	virtual bool addFeatures(vector<String>& fields,
		vector<vector<FD::Kernel::Variant> >& values,
		bool bigThanGeomMaxLen = false) {return false;}
	virtual bool getFeature(uint32 id,/*_out*/ FD::Kernel::DataStream &feature) {return false;}
	virtual bool getFeature(uint32 id,vector<FD::Kernel::Variant>& values,double & lenght,double & area,vector<size_t>& pos){return false;}
	virtual bool updateFeature(/*_in*/ FD::Kernel::DataStream &feature) {return false;}
	virtual uint32 getFeatureCount(FD::Kernel::DataStream &filter) { return 0;}
	virtual bool deleteFeature(uint32 id){ return false;}
	
	virtual bool updateExtent() {return false;}
	virtual bool getExtent(FD::Kernel::Geometry::Interface::IEnvelope *pEnvelope) {return false;}

	virtual bool query(FD::Kernel::DataStream &filter,String &key) {return false;}
	virtual bool nextFeature(FD::Kernel::DataStream &stream,const String &key) {return false;}
	virtual bool nextFeature(vector<FD::Kernel::Variant>& values,double & lenght,double & area,vector<size_t>& pos,const String & key){return false;}
	virtual bool select(/*_out*/ FD::Kernel::DataStream &os, /*_in*/ FD::Kernel::DataStream &filter) {return false;}
	virtual bool endQuery(const String &key) {return false;}
	virtual uint32 queryCount(/*_in*/ FD::Kernel::DataStream &filter){ return 0;}

	virtual bool createSpatialIndex(FD::Utility::DB::Interface::ISpatialIndexParam* param){ return false;}
	virtual bool rebulidSpatialIndex(){ return false;}
	virtual bool deleteSpatialIndex(){ return false;}
	
	virtual String getUpdateTime(){return "unknown";}
	virtual uint64 getDataVersion() {return 1;}
	virtual bool updateTime() {return false;}
	virtual bool updateDataVersion() {return false;}

	virtual bool addField(const FD::Utility::DB::Interface::IField* field){return false;}
	virtual bool deleteField(int32 index){return false;}

	virtual bool setSpatialReference(const FD::Kernel::Math::SpatialReference *sr) {return false;}

	virtual FD::Kernel::Variant max(const String &expression)
	{
		return FD::Kernel::Variant();
	}
	virtual FD::Kernel::Variant min(const String &expression)
	{
		return FD::Kernel::Variant();
	}
	virtual FD::Kernel::VariantArray getFieldValues(const String &fieldName,bool isUnique)
	{
		return FD::Kernel::VariantArray();
	}

	virtual bool Lock()
	{
		return false;
	}
	virtual bool UnLock()
	{
		return false;
	}

protected:                                                   
	CVectorFeatureClassOperator()
	{}


};


}}} // End of namespaces


#endif //_VECTORFETURECLASSOPERATOR_H_H_

